import request from "@/utils/request";

// /staff/employeeSign 判断是否是加油员账号
export function employeeSign() {
  return request({
    url: "/staff/employeeSign",
    method: "get",
  });
}

// 一级订单菜单，今日订单，历史订单，获取油站名称，不是admin账户获取的油站名称接口不同
export function getStationByEnterprise() {
  return request({
    url: "/station/order/getStationByEnterprise",
    method: "get",
  });
}

// 测试授权
export function testEmpower(query) {
  return request({
    url: "/thirdParty/weChat/getQRCode",
    method: "get",
    params: query,
  });
}

// 新增油企
export function addEnterprise(data) {
  return request({
    url: "/enterprise/info",
    method: "post",
    data: data,
  });
}

// 删除油企
export function delEnterprise(data) {
  return request({
    url: "/enterprise/info/deleteEnterprise",
    method: "post",
    data: data,
  });
}

// 更新油企
export function upEnterprise(data) {
  return request({
    url: "/enterprise/info",
    method: "put",
    data: data,
  });
}

// 查询油企列表
export function getEnterpriseList(query) {
  return request({
    url: "/enterprise/info/list",
    method: "get",
    params: query,
  });
}

// 查询油企列表,当做下拉选项
export function getListOption(query) {
  return request({
    url: "/enterprise/info/listOption",
    method: "get",
    params: query,
  });
}

// 新增渠道
export function addPayWay(data) {
  return request({
    url: "/payWay/info",
    method: "post",
    data: data,
  });
}

// 更新渠道
export function upPayWay(data) {
  return request({
    url: "/payWay/info",
    method: "put",
    data: data,
  });
}

// 查询渠道
export function getPayWayList(query) {
  return request({
    url: "/payWay/info/list",
    method: "get",
    params: query,
  });
}

// 查询油站所选的渠道
export function getPayWayListByStationId(query) {
  return request({
    url: "/payWayBetween/info/getStationPayInfo",
    method: "get",
    params: query,
  });
}

// 新增渠道
export function upPayWayListByStationId(data) {
  return request({
    url: "/station/message/addPayWay",
    method: "post",
    data: data,
  });
}

// 新增油品
export function addOil(data) {
  return request({
    url: "/oil/info",
    method: "post",
    data: data,
  });
}

// 删除油品
export function delOil(data) {
  return request({
    url: "/oil/info/delteOil",
    method: "post",
    data: data,
  });
}

// 更新油品
export function upOil(data) {
  return request({
    url: "/oil/info",
    method: "put",
    data: data,
  });
}

// 查询渠道
export function getOilList(query) {
  return request({
    url: "/oil/info/list",
    method: "get",
    params: query,
  });
}

// 查询油品 /stationOillGun/info/ometer/oilName
export function oilName(data) {
  return request({
    url: "/stationOillGun/info/ometer/oilName",
    method: "post",
    data: data,
  });
}

// 查询渠道
export function getOilListByLogin() {
  return request({
    url: "/oil/info/listByLogin",
    method: "get",
  });
}

// POST /stationOillGun/info/discount/oilName 立减活动根据油站选择油品
export function discountOilName(data) {
  return request({
    url: "/stationOillGun/info/discount/oilName",
    method: "post",
    data: data,
  });
}

// 查询渠道
export function getOilListByStationId(stationId) {
  return request({
    url: "/oil/info/listByStationId",
    method: "get",
    params: { stationId },
  });
}

// 新增渠道
export function addOilAndGun(data) {
  return request({
    url: "/stationOillGun/info",
    method: "post",
    data: data,
  });
}

// 更新渠道
export function upOilAndGun(data) {
  return request({
    url: "/stationOillGun/info",
    method: "put",
    data: data,
  });
}

// 查询渠道
export function getOilAndGunList(query) {
  return request({
    url: "/stationOillGun/info/list",
    method: "get",
    params: query,
  });
}

// 新增油罐
export function addOilTank(data) {
  return request({
    url: "/tank/info",
    method: "post",
    data: data,
  });
}

// 删除渠道
export function delOilTank(id) {
  return request({
    url: "/tank/info/" + id,
    method: "delete",
  });
}

// 删除渠道
export function delOilAndGun(data) {
  return request({
    url: "/stationOillGun/info/deleteStationOilGun",
    method: "post",
    data: data,
  });
}

// 更新油罐
export function upOilTank(data) {
  return request({
    url: "/tank/info",
    method: "put",
    data: data,
  });
}

// 查询油罐
export function getOilTankList(query) {
  return request({
    url: "tank/info/list",
    method: "get",
    params: query,
  });
}

// 新增油站
export function addStation(data) {
  return request({
    url: "/station/message",
    method: "post",
    data: data,
  });
}

export function delStation(data) {
  return request({
    url: "/station/message/deleteStation",
    method: "post",
    data: data,
  });
}

// 更新油站
export function upStation(data) {
  return request({
    url: "/station/message",
    method: "put",
    data: data,
  });
}

// 查询油站
export function getStationList(query) {
  return request({
    url: "/station/message/list",
    method: "get",
    params: query,
  });
}

// 新查询油站
export function listEnterpriseStation(query) {
  return request({
    url: "/station/message/listEnterpriseStation",
    method: "get",
    params: query,
  });
}

// 查询优惠劵详细
export function getInfo(id) {
  return request({
    url: "/coupon/info/" + id,
    method: "get",
  });
}

// 修改优惠劵
export function updateInfo(data) {
  return request({
    url: "/coupon/info",
    method: "put",
    data: data,
  });
}

// 删除优惠劵
export function delInfo(id) {
  return request({
    url: "/coupon/info/" + id,
    method: "delete",
  });
}

// 导出优惠劵
export function exportInfo(query) {
  return request({
    url: "/coupon/info/export",
    method: "get",
    params: query,
  });
}

// 导出优惠劵
export function verificationList(query) {
  return request({
    url: "/station/info/selectStationDifferent",
    method: "get",
    params: query,
  });
}

//查询优惠劵状态

export function selectCouponEnableFalge(data) {
  return request({
    url: "/coupon/info/selectCouponEnableFalge",
    method: "get",
    data: data,
  });
}
// 开启关闭优惠劵
export function changeCouponStatus(data) {
  return request({
    url: "/system/dept/updateDeptInfo",
    method: "put",
    data: data,
  });
}

// 新增优惠劵发放方式
export function addIssue(data) {
  return request({
    url: "/coupon/issue",
    method: "post",
    data: data,
  });
}

// 修改优惠劵发放方式
export function updateIssue(data) {
  return request({
    url: "/coupon/issue",
    method: "put",
    data: data,
  });
}
// 查询发放方式
export function listIssue(query) {
  return request({
    url: "/coupon/issue/list",
    method: "get",
    params: query,
  });
}

// 新增优惠劵发放方式
export function upIssueStatus(data) {
  return request({
    url: "/coupon/issue/updateCouponIssueStatus",
    method: "put",
    data: data,
  });
}

// 用户优惠卷信息
export function queryCouponUserList(query) {
  return request({
    url: "/coupon/user/list",
    method: "get",
    params: query,
  });
}

export function getWxCardId(data) {
  return request({
    url: "/enterprise/info/createCardEnterprise",
    method: "post",
    data: data,
  });
}

// 新增油站充值
export function addRecharge(data) {
  return request({
    url: "/station/recharge",
    method: "post",
    data: data,
  });
}

// 油站余额
export function getBalance(stationId) {
  return request({
    url: "/station/recharge/" + stationId,
    method: "get",
  });
}
// 油站充值报表
export function getRechargeList(query) {
  return request({
    url: "/station/recharge/list",
    method: "get",
    params: query,
  });
}
// 导出报表
export function exportRecharge(query) {
  return request({
    url: "/station/recharge/export",
    method: "get",
    params: query,
  });
}

// 查询定时修改支付方式列表
export function listTimingWay(query) {
  return request({
    url: "/Timing/way/list",
    method: "get",
    params: query,
  });
}

// 查询定时修改支付方式详细
export function getTimingWay(timeId) {
  return request({
    url: "/Timing/way/" + timeId,
    method: "get",
  });
}

// 新增定时修改支付方式
export function addTimingWay(data) {
  return request({
    url: "/Timing/way",
    method: "post",
    data: data,
  });
}

// 修改定时修改支付方式
export function updateTimingWay(data) {
  return request({
    url: "/Timing/way",
    method: "put",
    data: data,
  });
}

// 删除定时修改支付方式
export function delTimingWay(timeId) {
  return request({
    url: "/Timing/way/" + timeId,
    method: "delete",
  });
}

// 导出定时修改支付方式
export function exportTimingWay(query) {
  return request({
    url: "/Timing/way/export",
    method: "get",
    params: query,
  });
}

// 获取商品信息（非油品）分页
export function getNonGoogsListApi(query) {
  return request({
    url: "/goods/page",
    method: "get",
    params: query,
  });
}

// 添加非油品商品
export function addNonOilGoodsInfoApi(goodsForm) {
  return request({
    url: "/goods",
    method: "post",
    data: goodsForm,
  });
}

// 根据id获取商品信息（非油品）
export function getNonOilGoogInfoByIdApi(id) {
  return request({
    url: "/goods/" + id,
    method: "get",
  });
}

// 编辑商品信息（非油品）
export function editNonOilGoodInfoAPi(goodsForm) {
  return request({
    url: "/goods/" + goodsForm.id,
    method: "put",
    data: goodsForm,
  });
}

// 修改商品状态信息（非油品）
export function changeNonOilGoodStatusApi(id, status) {
  return request({
    url: `/goods/id/${id}/status/${status}`,
    method: "put",
  });
}

// 删除商品信息（非油品）
export function delNonOilGoodsApi(ids) {
  return request({
    url: `/goods/${ids}`,
    method: "delete",
  });
}

// 获取油站清分信息
export function getStationSettleInfo(query) {
  return request({
    url: "/station/message/getStationSettleInfo",
    method: "get",
    params: query,
  });
}

// 保存清分
export function addOrUpdateSettleInfo(data) {
  return request({
    url: "/station/message/addOrUpdateSettleInfo",
    method: "post",
    data,
  });
}

export function getEnterpriseStationList(query) {
  return request({
    url: "/station/classSettlement/getEnterpriseStationList",
    method: "get",
    params: query,
  });
}

// POST /order/payType/name 获取名称
export function payTypeName(data) {
  return request({
    url: "/order/payType/name",
    method: "post",
    data,
  });
}

// POST /order/payType/list 获取支付方式列表
export function payTypeList(data) {
  return request({
    url: "/order/payType/list",
    method: "post",
    data,
  });
}

// POST /order/payType/save 保存支付方式
export function payTypeSave(data) {
  return request({
    url: "/order/payType/save",
    method: "post",
    data,
  });
}

// POST /order/payType/update 编辑支付方式
export function payTypeUpdate(data) {
  return request({
    url: "/order/payType/update",
    method: "post",
    data,
  });
}

// GET /order/payType/delete 删除支付方式
export function payTypeListDelete(query) {
  return request({
    url: "/order/payType/delete",
    method: "get",
    params: query,
  });
}
// 获取油企下的商户号列表
export function getMnoByEnterpriseIdApi(data) {
  return request({
    url: "/payWay/info/getMnoByEnterpriseId",
    method: "post",
    data,
  });
}
// 获取商户下的支付费率
export function getSXFMnoServiceChargeApi(data) {
  return request({
    url: "/payWay/info/getSXFMnoServiceCharge",
    method: "post",
    data,
  });
}
// 设置商户费率
export function setMnoAllRateApi(data) {
  return request({
    url: "/payWay/info/setMnoAllRate",
    method: "post",
    data,
  });
}
// 设置商户费率记录
export function selectMnoAllRateApi(data) {
  return request({
    url: "/payWay/info/selectMnoAllRate",
    method: "post",
    data,
  });
}
